<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        input {
            color: #999;
        }
    </style>
</head>
<body>
    <input type="text" value="手机">
    <script>
        var input = document.querySelector('input')

        //获得焦点时，value隐藏
        input.onfocus = function() {
            if(input.value === '手机') [
                input.value = ''
            ]
            input.style.color = '#333'
        }

        //失去焦点时，value显示
        input.onblur = function() {
            if(input.value.trim().length ===0) {
                input.value = '手机'
            }
            input.style.color = '#999'

        }

    </script>
</body>
</html>